package com.gxa.insurance.exception;

/**
 * 声明一个描述异常类型和消息的枚举
 *
 * @author bill
 * @date 2022/5/7 11:06
 */
public enum ExceptionCode {

    /**
     * 枚举要先把对象声明好,
     * 访问的时候,只能访问这些提前声明的对象
     * <p>
     * 在枚举出现之前(1.5之前),要达到相同的效果得通过静态常量
     * public static final String SERVER_FAILED = "50001";
     * code 是企业自己的规定
     * 后续再需要自定义异常信息的时候,再添加
     * 枚举值用全大写(java规定),且是英文(企业规定)
     * 多个枚举值之间用逗号隔开
     * 枚举值把所有的备选项都先设计好, 使用时只能从它们中间获取
     */
    SERVER_FAILED("50001", "服务器开小差了,请稍后再试"),
    DUPLICATE_USERNAME("50002", "重复的用户名"),
    DUPLICATE_PHONE("50003", "重复的手机号"),
    ADMIN_LOGIN_FAILED("50004", "管理员登录失败"),
    USER_LOGIN_FAILED("50005", "用户登录失败,请检查用户手机号或密码"),
    USER_NOT_FONUD("50006", "没有该用户,操作失败"),
    EMPTY_TOKEN("50007", "token信息不能为空"),
    WRONG_TOKEN("50008", "token错误"),
    WRONG_VALUE("50009", "参数信息错误"),
    DOWNLOAD_WRONG("50010", "下载错误"),
    WRONG_MESSAGE("50011", "短信验证码错误"),
    WRONG_PHONE_NUMBER("50012", "错误的手机号"),
    SEND_SMS_FAILED("50013", "发送短信失败"),
    CUSTOMER_IS_EMPTY("50014", "用户列表空,请添加新用户"),
    DUPLICATE_CITY("50015", "重复的城市"),
    EMPTY_LIST("50016", "列表为空"),
    S4SHOP_NOT_FONUD("50017", "没有该4s店,操作失败"),
    S4SHOP_IS_EMPTY("50018", "4s店列表空,操作失败"),
    INSERT_S4SHOP_FAILED("50019", "添加4s店,操作失败"),
    UPDATE_S4SHOP_FAILED("50020", "修改4s店,操作失败"),
    DELETE_S4SHOP_FAILED("50021", "删除4s店,操作失败"),
    ROLE_IS_EMPTY("50022", "角色列表空,操作失败"),
    PERMISSION_IS_EMPTY("50023", "角色列表空,操作失败"),
    INSERT_ROLEPERMISSION_FAILED("50024", "添加角色权限,操作失败"),
    DELETE_ROLEPERMISSION_FAILED("50025", "删除角色权限,操作失败"),
    INSERT_AUTOMOBILEBRAND_FAILED("50026", "添加汽车品牌,操作失败"),
    AUTOMOBILEBRAND_IS_EMPTY("50027", "汽车品牌列表空,操作失败"),
    EXPRESSREPAIRSHOP_NOT_FONUD("50028", "没有该快修店,操作失败"),
    EXPRESSREPAIRSHOP_IS_EMPTY("50029", "快修店列表空,操作失败"),
    INSERT_EXPRESSREPAIRSHOP_FAILED("50030", "添加快修店,操作失败"),
    UPDATE_EXPRESSREPAIRSHOP_FAILED("50031", "修改快修店,操作失败"),
    DELETE_EXPRESSREPAIRSHOP_FAILED("50032", "删除快修店,操作失败"),
    REPAIRDEPOT_NOT_FONUD("50033", "没有该修理厂,操作失败"),
    REPAIRDEPOT_IS_EMPTY("50034", "修理厂列表空,操作失败"),
    INSERT_REPAIRDEPOT_FAILED("50035", "添加修理厂,操作失败"),
    UPDATE_REPAIRDEPOT_FAILED("50036", "修改修理厂,操作失败"),
    DELETE_REPAIRDEPOT_FAILED("50037", "删除修理厂,操作失败"),
    AREA_IS_EMPTY("50038", "修理厂地址列表空,操作失败"),
    UPDATE_FILED("50039", "更新失败"),
    DELETE_FILED("50040", "删除失败"),
    INSERT_FILED("50041", "添加失败"),
    WRONG_ORDER_TYPE("50042", "错误的订单类型"),
    PAYNUMBER_NOT_FOUND("50043", "没有该支付订单,操作失败"),
    NEWCARORDER_NOT_FONUD("50044", "没有该新车上牌订单,操作失败"),
    UPDATE_NEWCARORDER_FAILED("50045", "修改新车上牌订单,操作失败"),
    ORDER_NOT_FONUD("50046", "没有该总订单,操作失败"),
    CARORDER_NOT_FONUD("50047", "没有该新车上牌订单,操作失败"),
    UPDATE_ORDER_FAILED("50048", "修改总订单,操作失败"),
    UPDATE_CARORDER_FAILED("50049", "修改新车上牌订单,操作失败"),
    INSERT_ORDERATTACHMENTIMAGE_FAILED("50050", "添加订单图片附件,操作失败");
    private String code;
    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    ExceptionCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
